The XML which can freely define a logical structure of a document and significance of a constituent is widespread today as a document description language for use in packet switching on a computer network represented by the Internet. When an XML document is used in an application program, it is necessary to analyze the XML document to be processed. The XPath is used in this event. The XPath is a language for defining a sentence which indicates a specific part of an XML document, which is the specification recommended by the World Wide Web Consortium (W3C). By use of the XPath, it is possible to analyze whether or not a given XML document includes a specific logical structure or a constituent (see Non-patent Literature 1, for example).
A structure of an XML document can be expressed by a tree structure. An XML document is expressed by use of the Document Object Model (DOM), which is the specification recommended by the W3C, or the like. When the XML document is analyzed by use of the XPath, the entire XML document expressed in the DOM or the like is usually subjected to scanning to check whether the XML document has a structure described with the XPath or not. Therefore, an analyzing system for XML documents needs to read the entire XML document to be analyzed into a given memory in order to perform processing.
As described above, when an XML document is analyzed by use of the XPath, for example XML Path Language (XPath) Version 1.0, it has been conventionally necessary to read the entire XML document to be analyzed once into a work area of a memory. However, when the data size of the XML document to be analyzed is huge, large memory usage is required to read the XML document as description of the DOM or the like. Moreover, a lot of time is required for processing of generation and operation of the DOM.
In the case of using a streaming-based application program interface (API) such as the Simple API for XML (SAX) or the Xerces Native Interface (XNI), it is inefficient that the processing can be started only after reading the entire XML document once in order to perform an analysis by use of the XPath, in spite of the fact that the API can perform serial processing of the XML document obtained in accordance with a streaming format.